<template>
  <div>
    <van-nav-bar
      title="专题课教师"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <van-form @submit="onSubmit">
      <van-field
        v-model="teachName"
        name="教师名称"
        label="教师名称"
        placeholder="教师名称"
        :rules="[{ required: true, message: '请填写教师名称' }]"
      />
      <van-field
        v-model="lessName"
        name="课程名称"
        label="课程名称"
        placeholder="课程名称"
        :rules="[{ required: true, message: '请填写课程名称' }]"
      />
      <van-field
        v-model="classUnion"
        name="涉及班级"
        label="涉及班级"
        placeholder="涉及班级"
        :rules="[{ required: true, message: '请填写涉及班级' }]"
      />
      <div style="margin: 16px;">
        <van-button round block type="info" native-type="submit">查询</van-button>
      </div>
    </van-form>
  </div>
</template>

<script>
export default {
  created() {
    this.$data.role = this.$route.query.role;
  },
  data() {
      return {
        role:-1,
        lessName: '',
        teachName: '',
        classUnion: ''
      };
    },
    methods: {
      onSubmit(values) {
        console.log('submit', values);
      },
      onClickLeft() {
        this.$router.push({path:'/home',query:{role:this.$data.role}})
      },
    },
}
</script>

<style>
</style>
